// index.js
// 获取应用实例
const app = getApp()

Page({
  data: {
    dataTree: [
      {
        id: 1,
        name: '一级A',
        children: [
          {
            id: 23,
            pid: 1,
            name: '二级A-a',
            children: [
              {
                pid: 23,
                id: 98,
                name: '三级A-a-1'
              }
            ]
          },
          {
            id: 20,
            pid: 1,
            name: '二级A-b',
          }
        ]
      },
      {
        id: 2,
        name: '一级B',
        children: [
          {
            pid: 2,
            id: 21,
            name: '二级B-a',
          }
        ]
      }
    ],
  },

  onLoad() {

  },
  // 获取选中数据
    getSelectedTree() {
      let checked = this.selectComponent('#tree').getSelected();
      console.log(checked)
    },

})
